#!/bin/bash

if [ $# -ne 2 ] || [ $1 = '-h' ]
then
  echo -e "\tFirst arg : random text\n\tsecond arg : dictionary "
fi
bool=false
[ -e $1 ] || echo -e "Le fichier $1 est invalide" && bool=true
[ -e $2 ] || echo -e "Le fichier $2 est invalide" && bool=true
[ $bool ] # && exit

for WORD in `cat $1`
do
   if ! grep -q $WORD $2
   then
       echo $WORD >> $2
   fi
done
sort -d $2 -o $2
